1) Field of the Invention
The present invention relates to a bar-code reader, a method of reading a bar code, and a computer program for reading a bar code efficiently and accurately.
2) Description of the Related Art
The bar-code system is well known in the field of products distribution. In this system, a product is provided with a bar code in advance and when the product is held up to a bar-code reader (bar-code scanner), the bar code of the product is read. By reading the bar code of a product, information of the product such as product price, product name etc. is obtained and recorded in a register.
Concretely, in the bar-code unit, the following series of processes is performed.    (1) A bar code is formed by an array of width information of black bars and white bars. A light beam is irradiated on the bar code, and light reflected from the bar code is received. An electric signal, having amplitude corresponding to an optical power of the reflected light, is generated.    (2) From the change in the amplitude of the electric signal, boundary signals (edge signals) of boundary from a white bar to a black bar and of boundary from a black bar to white bar are extracted.    (3) Distance between the edge signals extracted is measured as a bar-width counting value using a clock that has a resolution power from tens to hundreds of times of the bar width.    (4) From the bar-width counting value measured, the width of each bar that forms the bar code is measured and a ratio of widths of the white bars and black bars is calculated.
Thus, in the conventional bar-code reader, if the light reflected from the bar code has sufficient optical power and large amplitude, the ratio of widths of the white bars and the black bars can be known accurately. Consequently, the product information obtained with the help of the bar code is more accurate.
However, there are practical problems in operating a bar-code reader. For instance, if the light reflected from the bar code is insufficient, an error occurs in reading widths of bars of the bar code.
Sometimes black bars become thicker than desired, particularly, due to spreading of ink when the bar code is printed. Amplitude of reflected light declines due to the presence of a thick black bar or a thick white bar. This results in a misjudgment of a bar being a part of a white bar in spite of being a part of a black bar, and vice versa.
To describe this concretely, as illustrated in FIG. 3, a diameter of a light beam 31 that is irradiated on a bar code is originally set to be smaller that a basic distance between bars (see (a) in FIG. 3). This enables to acquire substantial reflected light, thereby acquiring sufficient value of an edge signal. However, if there is a thick black bar (see (b) in FIG. 3) or a thick white bar, substantial reflected light is not acquired. Therefore, a sufficient value of the edge signal is not acquired. This results in errors in reading the white and black bars of the bar code.
Moreover, if the distance between a reading surface of a bar-code reader and a bar code is large, the scanning speed of the light beam becomes relatively faster than the speed when the distance is less and the diameter of the light beam becomes greater than the basic distance between bars. This also results in an inability to acquire substantial reflected light, thereby leading to errors in reading the white and black bars of the bar code.
Japanese Patent Application Laid-open Publication No. H7-234913 discloses a technology to compensate the change in a level of a signal received, due to thickness of a black bar or a white bar, by applying an HPF (high pass filter) to an output of light that is received by a light receiving unit and that is reflected from a bar code. However, the disclosure is related only to an absorption of the change in a level of a signal received and does not prevent decline in an accuracy of reading that is caused due to problems such as a thick black bar etc.